<f:view
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:itdep="http://itdep.bsuir.by/jsf"
		>

	<ui:decorate template="/facelets/template/mainTemplate.xhtml">
		<f:loadBundle basename="bundle.department" var="departmentBundle"/>

		<f:loadBundle basename="bundle.plan" var="planBundle"/>
		<ui:param name="title" value="Plan details"/>
		<ui:define name="center">
			<ui:decorate template="/facelets/template/centerTemplate.xhtml">
				<ui:define name="content">
					<ui:decorate template="/facelets/template/planPanelTemplate.xhtml">
					</ui:decorate>
					<a4j:form>
						<a4j:commandLink value="#{planBundle.backToPlans}" action="toPlanDictionary"/>
					</a4j:form>
					<ui:decorate template="/facelets/template/dataTableTemplate.xhtml">
						<ui:param name="title" value="#{planBundle.contentPlans}"/>
						<ui:param name="actionBean" value="#{contentPlanBean}"/>
						<ui:param name="idPrefix" value="contentPlanlist"/>
						<ui:param name="showAddLink" value="true"/>
						<ui:define name="tableContext">
							<rich:column>
								<f:facet name="header"><h:outputText value="#{planBundle.subject}"/></f:facet>
								<itdep:entityOutput value="#{record.subject}" format="{i18n.fullName}"
													locale="#{specialityBean.translationBean.locale}"/>
							</rich:column>
							<rich:column>
								<f:facet name="header"><h:outputText
										value="#{departmentBundle.academicDepartment}"/></f:facet>
								<itdep:entityOutput value="#{record.department}" format="{i18n.fullName}"
													locale="#{facultyBean.translationBean.locale}"/>
							</rich:column>

							<rich:column>
								<f:facet name="header"><h:outputText value="#{planBundle.section}"/></f:facet>
								<itdep:entityOutput value="#{record.section}" format="{i18n.description}"
													locale="#{sectionDicBean.translationBean.locale}"/>

							</rich:column>
							<rich:column>
								<f:facet name="header"><h:outputText
										value="#{departmentBundle.specialization}"/></f:facet>
								<h:panelGrid rendered="#{!empty record.specialization}">
									<itdep:entityOutput value="#{record.specialization}" format="{i18n.fullName}"
														locale="#{specializationBean.translationBean.locale}"/>
								</h:panelGrid>

							</rich:column>
							<rich:column width="21%">
								<f:facet name="header"><rich:spacer/></f:facet>
								<h:commandLink value="#{planBundle.details}"
											   action="#{contentPlanBean.showContentPlanDetails}"/>

							</rich:column>
							<rich:column width="1%">
								<f:facet name="header"><rich:spacer/></f:facet>
								<h:panelGroup style="white-space:nowrap;">
									<a4j:commandLink value="#{commonBundle.edit}" action="#{contentPlanBean.edit}"
													 reRender="#{idPrefix}TablePanel" immediate="true"/>
									<rich:spacer width="7"/>
									<a4j:commandLink value="#{commonBundle.delete}" action="#{contentPlanBean.delete}"
													 reRender="#{idPrefix}TablePanel" immediate="true"/>
								</h:panelGroup>
							</rich:column>
						</ui:define>
					</ui:decorate>
					<a4j:form>
						<a4j:commandLink value="#{planBundle.sessions}" action="#{contentPlanBean.showSessionPlan}"
										 immediate="true"/>
					</a4j:form>
				</ui:define>


			</ui:decorate>

		</ui:define>
	</ui:decorate>

</f:view>